from bs4 import BeautifulSoup
import urllib.request

# 官网： https://www.mxbc.com/product#series

url = "https://www.mxbc.com/product"

response = urllib.request.urlopen(url)
html = response.read().decode("utf-8")
soup = BeautifulSoup(html, "lxml")

# //li[@class='row-3']//article/h1/text()
name_list = soup.select(".row-3 article>h1")
img_list = soup.select(".row-3 figure>img")
print("输出蜜雪冰城的产品名称和图片地址：")
for i in range(len(name_list)):
    print("产品名称："+name_list[i].get_text(), "图片地址：https://www.mxbc.com/" + img_list[i].get("data-original"))

